/* Light blue, clean theme with navbar and mobile-friendly controls */
:root{
	--bg: #f4fbff; /* very light blue */
	--surface: #ffffff;
	--muted: #5b7088;
	--accent: #2b8cff; /* blue */
	--accent-2: #0b66d1;
	--danger: #e53935;
	--radius:10px;
	--border: #e6efff;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;background:var(--bg);color:#10263b}
main{max-width:980px;margin:18px auto;padding:18px}

/* Navbar */
.navbar{background:var(--surface);border-bottom:1px solid var(--border);padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;left:0;right:0;z-index:9999}
.brand{font-weight:700;color:var(--accent);font-size:18px}
.nav-links{display:flex;gap:10px;align-items:center}
.nav-links a{color:var(--muted);text-decoration:none;padding:8px 10px;border-radius:8px}
.nav-links a.active, .nav-links a:hover{background:linear-gradient(90deg, rgba(43,140,255,0.08), rgba(11,102,209,0.06));color:var(--accent-2)}

/* nav toggle (hamburger) */
.nav-toggle{display:none;width:40px;height:40px;border-radius:8px;border:1px solid var(--border);background:transparent;align-items:center;justify-content:center;cursor:pointer;z-index:60}
.nav-toggle svg{width:20px;height:20px;display:block}

/* Card */
.card{background:var(--surface); border-radius:var(--radius); padding:14px; box-shadow: 0 4px 18px rgba(16,38,59,0.06);}

h1{margin:0 0 12px 0;font-weight:700;color:#0b2740}

/* Big circular start/stop button */
.big-btn-wrap{display:flex;align-items:center;justify-content:center;margin:18px 0}
.big-btn{width:120px;height:120px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700;cursor:pointer;border:none;background:linear-gradient(180deg,var(--accent), var(--accent-2));color:#fff;box-shadow:0 8px 20px rgba(43,140,255,0.18);}
.big-btn.running{background:linear-gradient(180deg,#ff7a7a,#ff4b4b)}
.big-btn.small{width:84px;height:84px;font-size:16px}

/* Controls and buttons */
.controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.btn{background:transparent;border:1px solid var(--border);padding:8px 12px;border-radius:8px;color:var(--muted);cursor:pointer}
.btn.primary{background:linear-gradient(90deg,var(--accent),var(--accent-2));color:#fff;border:none}
.btn.danger{background:linear-gradient(90deg,#ffb4b4,#ff7a7a);color:#fff;border:none}

/* Form */
input[type=text], input[type=password], textarea{width:100%;padding:10px;border-radius:8px;border:1px solid var(--border);background:transparent;color:inherit}
label{font-size:13px;color:var(--muted);display:block;margin-bottom:6px}

/* Table */
table{width:100%;border-collapse:collapse;margin-top:8px;background:var(--surface);border-radius:6px;overflow:hidden;table-layout:fixed}
thead th{background:#f6fbff;padding:10px;text-align:left;font-size:13px;color:var(--muted);border-bottom:1px solid var(--border)}
tbody td{padding:10px;border-bottom:1px solid var(--border);font-size:14px}
/* ensure all table cells are left-aligned and do not change width when content changes */
table th, table td { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:nth-child(even){background:#fbfdff}

/* compact time/date display used in table cells */
.time-inline{white-space:nowrap; font-weight:700}
.time-inline .time-date{font-weight:400;color:var(--muted);font-size:13px}

/* inline edit input styling */
.inline-edit{font-size:14px;padding:6px 8px;border-radius:6px;border:1px solid var(--border);width:100%;box-sizing:border-box;max-width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Hide clear/reset buttons and native spinner controls on date/time inputs so editing
	 datetime-local or date/time fields does not show a clear (×) button across browsers. */
input[type="datetime-local"], input[type="date"], input[type="time"]{
	/* keep native picker but suppress clear/inner controls */
	-webkit-appearance: textfield; /* prevents webkit from showing extra clear icon */
}
/* WebKit/Blink: hide clear button and spin buttons */
input[type="datetime-local"]::-webkit-clear-button,
input[type="date"]::-webkit-clear-button,
input[type="time"]::-webkit-clear-button,
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button{
	display:none !important;
	-webkit-appearance: none;
}
/* IE/Edge */
input::-ms-clear, input::-ms-expand { display: none; }
/* Firefox - remove the clear button if any (uses appearance) */
input[type="datetime-local"], input[type="date"], input[type="time"]{appearance: textfield}

/* When mobile keyboard shows, add bottom padding so focused inputs scroll above it */
.keyboard-open main{padding-bottom:40vh}

.status-busy{color:#d97706;font-weight:600}
.status-free{color:#057a55}

@media (max-width:560px){
	/* make the big start/stop button take roughly half the mobile viewport and stay centered */
	.big-btn{width:48vw;height:48vw;font-size:20px;max-width:260px;max-height:260px}
	thead th{font-size:12px}
	tbody td{font-size:13px}
	.nav-links{display:none}
	.nav-toggle{display:flex}

	/* when navbar has .open, show links as a stacked mobile menu */
	.navbar.open .nav-links{display:flex;flex-direction:column;position:absolute;left:0;right:0;top:100%;background:var(--surface);padding:10px;border-bottom:1px solid var(--border);box-shadow:0 8px 20px rgba(16,38,59,0.06);z-index:55}
	.navbar.open .nav-links a{padding:12px;border-radius:6px}

	 /* Improve table layout on small screens: keep table semantics and allow horizontal scroll on the container
		 This ensures thead and tbody columns line up correctly. */
	 .card{padding:10px; overflow-x:auto; -webkit-overflow-scrolling:touch}
	 .card table{width:100%; min-width:700px; border-collapse:collapse; table-layout:fixed; border-radius:6px}
	 .card table th, .card table td{min-width:110px; padding:10px 12px; white-space:nowrap; box-sizing:border-box}
	 tbody td{font-size:13px}

	 /* Ensure start (1st) and end (2nd) columns show fully on narrow screens */
	 .card table th:nth-child(1), .card table td:nth-child(1),
	 .card table th:nth-child(2), .card table td:nth-child(2) {
		 min-width: 120px; /* ensure full YYYY-MM-DD HH:MM is visible */
		 white-space: nowrap; /* do not wrap times */
	 }
}

/* center the big button vertically on small screens when possible */
@media (max-height:700px){
	.big-btn-wrap{min-height:60vh;align-items:center}
	main{padding-top:10px}
}

.export-link{display:inline-block;padding:8px 12px;border-radius:8px;background:#fff;border:1px solid var(--border);color:var(--muted);text-decoration:none}

#history ul{padding-left:16px}
#history li{margin:8px 0}
.note{font-size:13px;color:var(--muted);margin-top:8px}

